import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
// 个人资料
// 用户模块
import UserList from '../components/User/List.vue'
import UserEdit from '../components/User/Edit.vue'
// 菜单模块
import MenuList from '../components/Menu/List.vue'
import MenuEdit from '../components/Menu/Edit.vue'
// 权限模块
import GroupList from '../components/Group/List.vue'
import GroupEdit from '../components/Group/Edit.vue'
import GroupRole from '../components/Group/Role.vue'

const mainRouter = new VueRouter({
	routes: [
		{path: '/login',name: 'login',component: Login},
		{path: '/', name: 'home', component: Home,children:[
			{path: '/user/list', component: UserList},
			{path: '/user/add', component: UserEdit},
			{path: '/user/edit/:id', component: UserEdit,props: true},
			{path: '/menu/list', component: MenuList},
			{path: '/menu/add', component: MenuEdit},
			{path: '/menu/edit/:id', component: MenuEdit,props: true},
			{path: '/group/list', component: GroupList},
			{path: '/group/add', component: GroupEdit},
			{path: '/group/edit/:id', component: GroupEdit,props: true},
			{path: '/group/role/:group', component: GroupRole,props: true}
		]},
		{path: '/user/list', name: 'userlist', component: UserList},
	]
})
export default mainRouter